//
//  CYLoveCarViewController.m
//  Toyota
//
//  Created by ld on 2024/6/25.
//

#import "CYLoveCarViewController.h"
#import "ServiceManagementVC.h"
#import "PowerSupplyModeVC.h"
#import "AntiTheftModeVC.h"
#import "Helper.h"
@interface CYLoveCarViewController ()

@end

@implementation CYLoveCarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    NSArray * btnArr = @[@"服务管理", @"供电模式", @"防盗模式"];
    
    for (int i = 0; i < btnArr.count; i++) {
        UIButton * cellBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        cellBtn.frame = CGRectMake(ScreenWidth / 2. - 60, 200 +  90 * i, 120, 50);
        [cellBtn setTitle:btnArr[i] forState:(UIControlStateNormal)];
        [cellBtn border:1 color:kColor999999];
        cellBtn.tag = 1000 + i;
        [cellBtn setTitleColor:kColor666666 forState:(UIControlStateNormal)];
        [cellBtn addTarget:self action:@selector(cellBtnAction:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:cellBtn];
        
    }
    // Do any additional setup after loading the view.
}


- (void)cellBtnAction:(UIButton *)sender {
    if (sender.tag == 1000) {
        CYLog(@"服务管理");
        ServiceManagementVC * vc = [[ServiceManagementVC alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:NO];
    }else if (sender.tag == 1001) {
        CYLog(@"供电模式");
        PowerSupplyModeVC * vc = [[PowerSupplyModeVC alloc]init];
        [self.navigationController pushViewController:vc animated:NO];
    }else if (sender.tag == 1002) {
        CYLog(@"防盗模式");
        AntiTheftModeVC * vc = [[AntiTheftModeVC alloc]init];
        [self.navigationController pushViewController:vc animated:NO];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
